package com.jbt.mds.obdsdk;

import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

import com.jbt.mds.sdk.diagnosis.dtc.Dtc;
import com.jbt.mds.sdk.model.DataStreamInfo;
import com.jbt.mds.sdk.model.ECUInfo;
import com.jbt.mds.sdk.obd.AbortCode;
import com.jbt.mds.sdk.obd.IObdDetector;
import com.jbt.mds.sdk.obd.ObdDetector;

import java.util.List;

/**
 * 饿汉式
 * 静态变量创建类的对象
 */
public class Singleton {


   static volatile boolean isInit = false;

    private static ObdDetector mObdDetector;
    public static void initialize(AppCompatActivity activity,IObdDetector iObdDetector){
      if(!isInit){
          isInit = true;
          mObdDetector = ObdDetector.getInstance();
          mObdDetector.init(activity, iObdDetector);
      }
    }
    public static ObdDetector getObdDetector() {

        return mObdDetector;
    }

    public static void setObdDetector(ObdDetector obdDetector) {
        Singleton.mObdDetector = obdDetector;
    }
}
